<?php
/**
 * Render blog platform
 * @author Khanh Nguyen <khanh.nguyen.le@outlook.com>
 */
class HomeModule extends CWebModule
{
    public $layoutPath = '';
	public function init()
	{
		// this method is called when the module is being created
		// you may place code here to customize the module or the application

		// import the module-level models and components
		$this->setImport(array(
			'home.models.*',
			'home.components.*',
		));
        $this->defaultController = 'view';
	}

	public function beforeControllerAction($controller, $action)
	{
		if(parent::beforeControllerAction($controller, $action))
		{
			if ($this->layoutPath == '') {
                $this->layoutPath = Yii::getPathOfAlias('application.views.layouts');
            }

            $this->setLayoutPath($this->layoutPath);
			return true;
		}
		else
			return false;
	}
}
